<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/pintuer.css">
<link rel="stylesheet" href="__PUBLIC__/Admin/css/admin.css">
<script src="__PUBLIC__/Admin/js/jquery.js"></script>
<script src="__PUBLIC__/Admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 成员列表</strong></div>
  <table class="table table-hover text-center">
    <tr>
      <th width="8%">成员姓名</th>
      <th width="12%">成员职称</th>
      <th width="12%">成员称号</th>
      <th width="12%">成员图像</th>
      <th width="12%">成员简介</th>
      <th width="10%">排序(数字越大越靠前)</th>
      <th width="12%">操作</th>
    </tr>
    <foreach name="arts" item="a">
    <tr>
      <td>{$a['username']}</td>
      <td>{$a['title']}</td>
      <td>{$a['discrip']}</td>
      <td><img height="100" src="{$a['user_img']}" alt=""></td>
      <td>{$a['content']|mb_substr=0,90}...</td>
      <td><input class="user_sort" style="width:40px" id="{$a['uid']}" type="number" value="{$a['sort']}"><br/>确认回车</td>
      <td><div class="button-group">
      <a class="button border-main" href="{:U('Admin/user/useredit',array('aid'=>$a['uid']))}"><span class="icon-edit"></span> 修改</a>
      <a class="button border-red" href="javascript:void(0)" onclick="return del(17)"><span class="icon-trash-o"></span> 删除</a>
      </div></td>
    </tr>

    </foreach>
    <tr>
      <td colspan="8"><div class="pagelist">{$page}</div></td>
    </tr>
  </table>
</div>

</body></html>
<script>
function del(id) {
    if (confirm("您确定要删除吗?")) {

    }
}
    //视频排序
$(".user_sort").keyup(function(event){
    var sort = $(this).val();
    var id = $(this).attr('id');
    console.log(sort)

    if (event.keyCode == "13") {
        $.ajax({
            url: '{:U('User/sort')}',
            data: {'uid':id, 'sort':sort},
            type:'POST',
            success: function(res){
                if(res.code == 1){
                    alert(res.message);
                }else{
                    alert(res.message);
                }
            }
        });
    }
})
</script>